{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "4aef135d",
   "metadata": {},
   "outputs": [],
   "source": [
    "info = {\n",
    "    \"stu1801\":\"ZiQi\",\n",
    "    \"stu1802\":\"XiaoFeng\",\n",
    "    \"stu1803\":\"LiuYu\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "d369f0ef",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'stu1801': 'ZiQi', 'stu1802': 'XiaoFeng', 'stu1803': 'LiuYu'}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f753e9d7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "stu1801\n",
      "stu1802\n",
      "stu1803\n"
     ]
    }
   ],
   "source": [
    "#  循环遍历一个字典\n",
    "# i是 item 在字典循环中打印的是什么？key\n",
    "# 我想循环遍历整个内容怎么做？\n",
    "for i in info:\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "6e8f3170",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "stu1801 ZiQi\n",
      "stu1802 XiaoFeng\n",
      "stu1803 LiuYu\n"
     ]
    }
   ],
   "source": [
    "# 循环遍历整个字典的 items\n",
    "for k,v in info.items():\n",
    "    print(k,v)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9dc714cd",
   "metadata": {},
   "source": [
    "有顺序才可以枚举 而字典不一样（加上.items)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "264a068b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践一：stu1801 中 取出数字，作为新的字典key\n",
    "new_info = {}\n",
    "for k,v in info.items():\n",
    "    # 用字典新增的方式创建字典\n",
    "    new_info[k[3:]] = v"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "2f8a7b02",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'1801': 'ZiQi', '1802': 'XiaoFeng', '1803': 'LiuYu'}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "380051f2",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践二： value 我也想变，所有字母大写\n",
    "new_info = {}\n",
    "for k,v in info.items():\n",
    "    # 用字典新增的方式创建字典\n",
    "    new_info[k[3:]] = v.upper()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "5a0ebbed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'1801': 'ZIQI', '1802': 'XIAOFENG', '1803': 'LIUYU'}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "76c277a7",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践三： 让new_info key 由'1801' => 1801\n",
    "new_info = {}\n",
    "for k,v in info.items():\n",
    "    # 用字典新增的方式创建字典\n",
    "    new_info[int(k[3:])] = v.upper()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "a3d6dcb6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1801: 'ZIQI', 1802: 'XIAOFENG', 1803: 'LIUYU'}"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_info"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cd17139e",
   "metadata": {},
   "source": [
    "{\n",
    " \"cells\": [\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 1,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [\n",
    "    {\n",
    "     \"data\": {\n",
    "      \"text/html\": [\n",
    "       \"<!-- （勿改动，执行即可）执行更改背景 -->\\n\",\n",
    "       \"<link rel=\\\"stylesheet\\\" href=\\\"exam.css\\\" type=\\\"text/css\\\">\\n\",\n",
    "       \"<h1 style=\\\"color: red;\\\">注意单元格的第一行不能改动，否则会影响自动打分</h1>\"\n",
    "      ],\n",
    "      \"text/plain\": [\n",
    "       \"<IPython.core.display.HTML object>\"\n",
    "      ]\n",
    "     },\n",
    "     \"metadata\": {},\n",
    "     \"output_type\": \"display_data\"\n",
    "    }\n",
    "   ],\n",
    "   \"source\": [\n",
    "    \"\\n\",\n",
    "    \"%%html\\n\",\n",
    "    \"<!-- （勿改动，执行即可）执行更改背景 -->\\n\",\n",
    "    \"<link rel=\\\"stylesheet\\\" href=\\\"exam.css\\\" type=\\\"text/css\\\">\\n\",\n",
    "    \"<h1 style=\\\"color: red;\\\">注意单元格的第一行不能改动，否则会影响自动打分</h1>\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 2,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [\n",
    "    {\n",
    "     \"data\": {\n",
    "      \"text/markdown\": [\n",
    "       \"# Python 期中考（B卷）：目前工作目录C:\\\\Users\\\\2SXL20300\\n\",\n",
    "       \"* 共6题，每题20分，80分及格，最高分120，作题时间90分钟。\\n\",\n",
    "       \"*  答题格首行如 ***# 003*** 勿删除或改动 \\n\",\n",
    "       \"* 可先挑难度较易的题先做，🌶个数愈高愈难\\n\",\n",
    "       \"* 执行一格格，最后一格可回报分数（仅供参考）\\n\",\n",
    "       \" ##提交此.ipynb档，必检查： \\n\",\n",
    "       \"   * 档名✍B_学号✍（只能用半角数字9码）\\n\",\n",
    "       \"   *  下格 输入学号（半角数字9码） \\n\",\n",
    "       \"\\n\",\n",
    "       \"\\n\",\n",
    "       \"# 🛂输入学号🛂\"\n",
    "      ],\n",
    "      \"text/plain\": [\n",
    "       \"<IPython.core.display.Markdown object>\"\n",
    "      ]\n",
    "     },\n",
    "     \"execution_count\": 2,\n",
    "     \"metadata\": {},\n",
    "     \"output_type\": \"execute_result\"\n",
    "    }\n",
    "   ],\n",
    "   \"source\": [\n",
    "    \"# 始001（勿改动，执行即可）\\n\",\n",
    "    \"e = %env\\n\",\n",
    "    \"_which_= \\\"B\\\"  # 卷号\\n\",\n",
    "    \"import PandasCourse as PC\\n\",\n",
    "    \"from IPython.display import Markdown\\n\",\n",
    "    \"Markdown(PC.msgs['opening'].format(w=_which_, d=e['HOMEDRIVE']+ e['HOMEPATH']))    \"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"markdown\",\n",
    "   \"metadata\": {},\n",
    "   \"source\": [\n",
    "    \"* 本试题参考数据信息：    \\n\",\n",
    "    \"> 1. df_C1:  作者地址(Author Address)         \\n\",\n",
    "    \"> 2. text:  所有作者地址 **文本数据**     \\n\",\n",
    "    \"> 3. info: 所有作者地址 **列表数据**\\n\",\n",
    "    \"> 4. AU: 作者数据信息 **列表数据**\\n\",\n",
    "    \"\\n\",\n",
    "    \"* **勿改动部分如稍有不慎改动，请重新下载该文件，浪费时间后果自负**\\n\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 3,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"# 0-1 数据准备\\n\",\n",
    "    \"# （勿改动，执行即可） 请观察text文本后再进行答题\\n\",\n",
    "    \"import pandas as pd\\n\",\n",
    "    \"df = pd.read_csv(\\\"WOS_2021.csv\\\",index_col=[0])\\n\",\n",
    "    \"df_C1 = df[['PY','C1']]\\n\",\n",
    "    \"text = '; '.join(df_C1.fillna(\\\"0\\\")['C1'].tolist())\\n\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 80,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"# print(text)\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"markdown\",\n",
    "   \"metadata\": {},\n",
    "   \"source\": [\n",
    "    \"# Q1（20分） 🌶 易\\n\",\n",
    "    \"* 查找<font style=\\\"color:red\\\">\\\"China\\\"</font>的次数\\n\",\n",
    "    \"\\n\",\n",
    "    \"--------------\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 7,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"phrase =  \\\"China\\\"  # 请在此作答\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 8,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [\n",
    "    {\n",
    "     \"data\": {\n",
    "      \"text/plain\": [\n",
    "       \"140\"\n",
    "      ]\n",
    "     },\n",
    "     \"execution_count\": 8,\n",
    "     \"metadata\": {},\n",
    "     \"output_type\": \"execute_result\"\n",
    "    }\n",
    "   ],\n",
    "   \"source\": [\n",
    "    \"# A-1 查找\\\"China\\\"的次数\\n\",\n",
    "    \"# 知识点： \\n\",\n",
    "    \"# 1. 变量的使用\\n\",\n",
    "    \"# 2. count\\n\",\n",
    "    \"freq_table_phrase = text.count(phrase)# 请在此作答\\n\",\n",
    "    \"freq_table_phrase\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"markdown\",\n",
    "   \"metadata\": {},\n",
    "   \"source\": [\n",
    "    \"# Q2 （20分） 🌶 易\\n\",\n",
    "    \"\\n\",\n",
    "    \"------------\\n\",\n",
    "    \"* 用英文 <font style=\\\"color:red\\\">\\\"; \\\\[ \\\"</font> 拆分,生成list_split列表，每一个句子将成为列表中独立的元素\\n\",\n",
    "    \"* 答案示例：\\n\",\n",
    "    \"```\\n\",\n",
    "    \"['[Han, Xueying; Stocking, Galen; Gebbie, Matthew A.; Appelbaum, Richard P.] Univ Calif Santa Barbara, Ctr Nanotechnol Soc, Santa Barbara, CA 93106 USA',\\n\",\n",
    "    \" 'Stocking, Galen] Univ Calif Santa Barbara, Dept Polit Sci, Santa Barbara, CA 93106 USA',\\n\",\n",
    "    \" 'Gebbie, Matthew A.] Univ Calif Santa Barbara, Dept Mat, Santa Barbara, CA 93106 USA',\\n\",\n",
    "    \" 'Appelbaum, Richard P.] Univ Calif Santa Barbara, Global & Int Studies, Santa Barbara, CA 93106 USA',\\n\",\n",
    "    \" 'De Castell, Suzanne] Univ Ontario, Inst Technol, Fac Educ, 11 Simcoe St N, Oshawa, ON L1H 7L7, Canada',\\n\",\n",
    "    \" 'Larios, Hector] Simon Fraser Univ, Sch Interact Arts Technol, Surrey, BC V3T 0A3, Canada',\\n\",\n",
    "    \" ...省略]\\n\",\n",
    "    \"```\\n\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 81,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"# B-1 用英文 \\\"; [ \\\" 拆分,生成list_split列表，每一个句子将成为列表中独立的元素\\n\",\n",
    "    \"list_split  =   text.split('; [')# 请在此作答\\n\",\n",
    "    \" # list_split\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"markdown\",\n",
    "   \"metadata\": {},\n",
    "   \"source\": [\n",
    "    \"# Q3 20分 易\\n\",\n",
    "    \"\\n\",\n",
    "    \"-------------\\n\",\n",
    "    \"* 筛选作者所有地址列表info中出现China的内容，组成新的列表(20分)\\n\",\n",
    "    \"* 答案示例：\\n\",\n",
    "    \"```\\n\",\n",
    "    \"USA_list: \\n\",\n",
    "    \"['[Freeman, Scott; Eddy, Sarah L.; McDonough, Miles; Okoroafor, Nnadozie; Jordt, Hannah; Wenderoth, Mary Pat] Univ Washington, Dept Biol, Seattle, WA 98195 USA; [Smith, Michelle K.] Univ Maine, Sch Biol & Ecol, Orono, ME 04469 USA',\\n\",\n",
    "    \" '[Henderson, Charles] Western Michigan Univ, Dept Phys, Kalamazoo, MI 49008 USA; [Henderson, Charles] Western Michigan Univ, Mallinson Inst Sci Educ, Kalamazoo, MI 49008 USA; [Finkelstein, Noah] Univ Colorado, Dept Phys, Boulder, CO 80309 USA',...\\n\",\n",
    "    \"```\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 82,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"# C-1 info: 所有作者列表\\n\",\n",
    "    \"info = df['C1'].fillna(\\\"空缺值\\\").tolist()\\n\",\n",
    "    \"# info\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 83,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"# C-2 请使用info列表\\n\",\n",
    "    \"# 1. 新建列表，方法：append\\n\",\n",
    "    \"# 2. in 方法 + 条件判断 if else\\n\",\n",
    "    \"# 3. for 循环 （基本的编程思维）\\n\",\n",
    "    \"\\n\",\n",
    "    \"China_list = []\\n\",\n",
    "    \"# 请在此作答\\n\",\n",
    "    \"for i in info:\\n\",\n",
    "    \"    if phrase in i:\\n\",\n",
    "    \"        China_list.append(i)\\n\",\n",
    "    \"# China_list\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"markdown\",\n",
    "   \"metadata\": {},\n",
    "   \"source\": [\n",
    "    \"#  Q4 （20分）🌶🌶 中等\\n\",\n",
    "    \"\\n\",\n",
    "    \"-----------------\\n\",\n",
    "    \"* 尝试用python代码取出 邮政编码（注：5位的数字信息（len(str)==5））并存进邮编列表中。\\n\",\n",
    "    \"* 答案示例：\\n\",\n",
    "    \"```\\n\",\n",
    "    \"['93106',\\n\",\n",
    "    \" '93106',\\n\",\n",
    "    \" '93106',\\n\",\n",
    "    \" '93106',\\n\",\n",
    "    \" '20548',\\n\",\n",
    "    \" '94305',\\n\",\n",
    "    \" ...\\n\",\n",
    "    \"```\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 25,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"# D-1 新建邮编_list空列表，后续得到邮编信息请增加(append)进此列表\\n\",\n",
    "    \"邮编_list = []\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 84,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"# D-2 请使用info列表数据筛选并尝试获取所有的邮编信息\\n\",\n",
    "    \"# 请在此作答\\n\",\n",
    "    \"# 知识点： \\n\",\n",
    "    \"# 1. for 循环\\n\",\n",
    "    \"# 2. 字符串方法： split，isdigit   （用户登陆和购物车）\\n\",\n",
    "    \"for i in info:\\n\",\n",
    "    \"    for j in i.split():\\n\",\n",
    "    \"        if j.isdigit() and len(j) == 5:\\n\",\n",
    "    \"            邮编_list.append(j)\\n\",\n",
    "    \"# 邮编_list\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"markdown\",\n",
    "   \"metadata\": {},\n",
    "   \"source\": [\n",
    "    \"# Q5 20分 稍难\\n\",\n",
    "    \"\\n\",\n",
    "    \"----------------\\n\",\n",
    "    \"* 尝试将年份列表中的值转换成整数,并统计每一年出现的次数和空缺值出现的次数，并以字典的形式展现。\\n\",\n",
    "    \"* 答案示例：\\n\",\n",
    "    \"```\\n\",\n",
    "    \"{'空缺值': 116,\\n\",\n",
    "    \" 2015: 111,\\n\",\n",
    "    \" 2014: 58,\\n\",\n",
    "    \" 2013: 42,\\n\",\n",
    "    \" ...\\n\",\n",
    "    \" ```\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 85,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"# E-1 数据准备（所有年份数据列表） 学生直接执行\\n\",\n",
    "    \"PY_list = df_C1['PY'].fillna(\\\"空缺值\\\").tolist()\\n\",\n",
    "    \"# PY_list\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 62,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [\n",
    "    {\n",
    "     \"data\": {\n",
    "      \"text/plain\": [\n",
    "       \"{'空缺值': 116,\\n\",\n",
    "       \" 2004: 2,\\n\",\n",
    "       \" 2005: 1,\\n\",\n",
    "       \" 2006: 2,\\n\",\n",
    "       \" 2007: 5,\\n\",\n",
    "       \" 2008: 4,\\n\",\n",
    "       \" 2009: 10,\\n\",\n",
    "       \" 2010: 10,\\n\",\n",
    "       \" 2011: 17,\\n\",\n",
    "       \" 2012: 21,\\n\",\n",
    "       \" 2013: 42,\\n\",\n",
    "       \" 2014: 58,\\n\",\n",
    "       \" 2015: 111,\\n\",\n",
    "       \" 2016: 138,\\n\",\n",
    "       \" 2017: 176,\\n\",\n",
    "       \" 2018: 221,\\n\",\n",
    "       \" 2019: 280,\\n\",\n",
    "       \" 2020: 330,\\n\",\n",
    "       \" 2021: 174}\"\n",
    "      ]\n",
    "     },\n",
    "     \"execution_count\": 62,\n",
    "     \"metadata\": {},\n",
    "     \"output_type\": \"execute_result\"\n",
    "    }\n",
    "   ],\n",
    "   \"source\": [\n",
    "    \"# E-2 尝试将年份列表中的值转换成整数,并统计每一年出现的次数和空缺值出现的次数，最终以字典的形式展现，示例代码参考上述markdown\\n\",\n",
    "    \"PY_count = {\\\"空缺值\\\":PY_list.count(\\\"空缺值\\\")}\\n\",\n",
    "    \"# 请在此作答\\n\",\n",
    "    \"# 知识点：\\n\",\n",
    "    \"# 1. for循环 + 条件判断 （基础的编程思维）\\n\",\n",
    "    \"# 2. for + range \\n\",\n",
    "    \"# 3. 字典的新建：创建字典的方法： dict[key] = value\\n\",\n",
    "    \"\\n\",\n",
    "    \"PY_digit_list = []\\n\",\n",
    "    \"for i in PY_list:\\n\",\n",
    "    \"    if i != '空缺值':\\n\",\n",
    "    \"        PY_digit_list.append(int(i))\\n\",\n",
    "    \"for i in range(2004,2022):\\n\",\n",
    "    \"    PY_count[i] = PY_digit_list.count(i)\\n\",\n",
    "    \"PY_count\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"markdown\",\n",
    "   \"metadata\": {},\n",
    "   \"source\": [\n",
    "    \"# Q6 20分 🌶🌶🌶 难 \\n\",\n",
    "    \"\\n\",\n",
    "    \"--------------\\n\",\n",
    "    \"* 按照列表下表索引建立字典，在字典中拆分作者，并统计每篇文章作者的人数\\n\",\n",
    "    \"> 1. 请以每篇文章的index作为字典的key；\\n\",\n",
    "    \"> 2. value中仍为字典，字典的key分别有：\\n\",\n",
    "    \">> 1. \\\"author_list\\\"：存储作者列表\\n\",\n",
    "    \">> 2. \\\"author_num\\\":统计作者个数\\n\",\n",
    "    \">> 3. 结果示例如下:\\n\",\n",
    "    \"```\\n\",\n",
    "    \"{0: {'author_list': ['Han, XY',\\n\",\n",
    "    \"   ' Stocking, G',\\n\",\n",
    "    \"   ' Gebbie, MA',\\n\",\n",
    "    \"   ' Appelbaum, RP'],\\n\",\n",
    "    \"  'author_num': 4},\\n\",\n",
    "    \" 1: {'author_list': ['De Castell, S',\\n\",\n",
    "    \"   ' Larios, H',\\n\",\n",
    "    \"   ' Jenson, J',\\n\",\n",
    "    \"   ' Smith, DH'],\\n\",\n",
    "    \"  'author_num': 4},\\n\",\n",
    "    \" 2: {'author_list': ['Putansu, SR'], 'author_num': 1},\\n\",\n",
    "    \" 3: {'author_list': ['Cira, NJ',\\n\",\n",
    "    \"   ' Chung, AM',\\n\",\n",
    "    \"   ' Denisin, AK',\\n\",\n",
    "    \"   ' Rensi, S',\\n\",\n",
    "    \"   ' Sanchez, GN',\\n\",\n",
    "    \"   ' Quake, SR',\\n\",\n",
    "    \"   ' Riedel-Kruse, IH'],\\n\",\n",
    "    \"  'author_num': 7},\\n\",\n",
    "    \"...后面省略\\n\",\n",
    "    \"```\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 66,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [\n",
    "    {\n",
    "     \"data\": {\n",
    "      \"text/plain\": [\n",
    "       \"['Han, XY', 'Stocking, G', 'Gebbie, MA', 'Appelbaum, RP']\"\n",
    "      ]\n",
    "     },\n",
    "     \"execution_count\": 66,\n",
    "     \"metadata\": {},\n",
    "     \"output_type\": \"execute_result\"\n",
    "    }\n",
    "   ],\n",
    "   \"source\": [\n",
    "    \"# 循环遍历整个数据，每一个循环结果进行split('; ')拆分\\n\",\n",
    "    \"'Han, XY; Stocking, G; Gebbie, MA; Appelbaum, RP'.split('; ')\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 86,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"# F-1 （勿改动，执行即可） 请先观察AU_list后再做题\\n\",\n",
    "    \"AU_list = df.AU.fillna(\\\"\\\").tolist()\\n\",\n",
    "    \"# AU_list\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 87,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": [\n",
    "    \"# 知识点：\\n\",\n",
    "    \"# 1. 枚举，enumerate\\n\",\n",
    "    \"# 2. for循环+ 条件判断\\n\",\n",
    "    \"# 3. 字典的创建\\n\",\n",
    "    \"AU_dict = {}\\n\",\n",
    "    \"for i,v in enumerate(AU_list):\\n\",\n",
    "    \"    if i != '':\\n\",\n",
    "    \"        # 需要计算的结果均有:\\n\",\n",
    "    \"        # 1. 索引值，2. 列表信息(author_list)，3. 列表的长度（auyhor_num）\\n\",\n",
    "    \"        AU_dict[i] = {'author_list':v.split('; '),'author_num':len(v.split('; '))}\\n\",\n",
    "    \"# AU_dict\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"markdown\",\n",
    "   \"metadata\": {},\n",
    "   \"source\": [\n",
    "    \"#  终 （勿改动，执行即可）回报答题分数\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": 79,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [\n",
    "    {\n",
    "     \"data\": {\n",
    "      \"text/plain\": [\n",
    "       \"{'你本次考试总分': 100,\\n\",\n",
    "       \" 'details': {'freq_table_phrase': 20,\\n\",\n",
    "       \"  'list_split': 20,\\n\",\n",
    "       \"  'China_list': 20,\\n\",\n",
    "       \"  '邮编_list': 20,\\n\",\n",
    "       \"  'PY_count': 20}}\"\n",
    "      ]\n",
    "     },\n",
    "     \"execution_count\": 79,\n",
    "     \"metadata\": {},\n",
    "     \"output_type\": \"execute_result\"\n",
    "    }\n",
    "   ],\n",
    "   \"source\": [\n",
    "    \"#终001 （勿改动，执行即可）回报答题分数\\n\",\n",
    "    \"import PandasCourse as PC\\n\",\n",
    "    \"\\n\",\n",
    "    \"score_details = PC.score_answers(locals(), _which_)\\n\",\n",
    "    \"score_details\"\n",
    "   ]\n",
    "  },\n",
    "  {\n",
    "   \"cell_type\": \"code\",\n",
    "   \"execution_count\": null,\n",
    "   \"metadata\": {},\n",
    "   \"outputs\": [],\n",
    "   \"source\": []\n",
    "  }\n",
    " ],\n",
    " \"metadata\": {\n",
    "  \"kernelspec\": {\n",
    "   \"display_name\": \"Python 3\",\n",
    "   \"language\": \"python\",\n",
    "   \"name\": \"python3\"\n",
    "  },\n",
    "  \"language_info\": {\n",
    "   \"codemirror_mode\": {\n",
    "    \"name\": \"ipython\",\n",
    "    \"version\": 3\n",
    "   },\n",
    "   \"file_extension\": \".py\",\n",
    "   \"mimetype\": \"text/x-python\",\n",
    "   \"name\": \"python\",\n",
    "   \"nbconvert_exporter\": \"python\",\n",
    "   \"pygments_lexer\": \"ipython3\",\n",
    "   \"version\": \"3.6.5\"\n",
    "  },\n",
    "  \"toc\": {\n",
    "   \"base_numbering\": 1,\n",
    "   \"nav_menu\": {},\n",
    "   \"number_sections\": true,\n",
    "   \"sideBar\": true,\n",
    "   \"skip_h1_title\": false,\n",
    "   \"title_cell\": \"Table of Contents\",\n",
    "   \"title_sidebar\": \"Contents\",\n",
    "   \"toc_cell\": false,\n",
    "   \"toc_position\": {\n",
    "    \"height\": \"calc(100% - 180px)\",\n",
    "    \"left\": \"10px\",\n",
    "    \"top\": \"150px\",\n",
    "    \"width\": \"339.111px\"\n",
    "   },\n",
    "   \"toc_section_display\": true,\n",
    "   \"toc_window_display\": false\n",
    "  }\n",
    " },\n",
    " \"nbformat\": 4,\n",
    " \"nbformat_minor\": 2\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ab18a844",
   "metadata": {},
   "source": [
    "第十周是进行考试，第十一周是对上周考试进行的答案解析，上面这个是我去许智超老师的gitee找到的B试卷的答案跟解析，可作为后期回顾"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e6a8039a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
